test(server): regression reproducers for #25698#25714
Merged
kitlangton merged 1 commit intodevfrom May 4, 2026
Merged
Conversation
Adds three regression tests that lock in the contracts behind Ope's cleanup PR #25698: 1. httpapi-ui.test.ts: 'strips upstream transfer-encoding header from proxied assets' — fails on dev today (transfer-encoding leaks through the UI proxy and triggers ERR_INVALID_CHUNKED_ENCODING in browsers). 2. httpapi-ui.test.ts: 'serves the PWA manifest without auth even when a server password is set' — fails on dev today (auth middleware rejects /site.webmanifest and the web-app-manifest icons with 401, breaking PWA install). 3. httpapi-listen.test.ts: 'PTY connect token requires matching directory across mint and connect' — passes on dev (the server already enforces strict directory scope match), but documents the contract Ope's app fix relies on. Without a directory query, the server resolves the PTY in its own cwd and returns 404 — the symptom the app hit when calling client.pty.connectToken({ ptyID }) without directory. On dev: 2 fail, 1 passes (3rd is contract-only). With #25698 applied: 3 pass.
fc90986 to
b0aacad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Three regression tests that fail on `dev` today and lock in the contracts behind @OpeOginni's cleanup PR #25698. CI will be red until #25698 lands; this PR is meant to either be:
State on dev today
The third test passes on dev because the server contract is correct — strict directory scope match between mint and consume. It documents that contract so future regressions on either side (server loosening match or app stopping to send directory) get caught. It's also the smallest reproducer of the symptom @OpeOginni hit: `POST /pty/{id}/connect-token` without `?directory=` returns 404 because the PTY is registered in another instance directory than the listener's cwd.
Verification
Locally cherry-picked #25698 onto this branch and re-ran:
```
bun run test test/server/httpapi-ui.test.ts test/server/httpapi-listen.test.ts
15 pass
0 fail
53 expect() calls
```
Recommendation
Close this draft and have @OpeOginni cherry-pick `fc90986ae` into #25698. The `routes/instance/AGENTS.md` parity guidance asks for regression coverage to live with the fix:
If folding in is awkward for any reason, this branch can land separately after #25698.